#include <stdio.h>
#include <string.h>
#include <unistd.h>

#define NUM 101
#define STYLE '#'

void process()
{
    char bar[NUM];
    memset(bar, '\0', sizeof(bar));

    const char* lable = "|/-\\";
    
    int cnt = 0;
    while(cnt <= 100)
    {
        printf("加载中:\033[34m%-100s\033[0m[%d%%][%c]\r", bar, cnt, lable[cnt%4]);
        fflush(stdout);
        bar[cnt++] = STYLE;
        usleep(40000);
    }
    printf("\n");
}

int main()
{
    process();
    
    return 0;
}
